
# Create your views here.
from django.conf import settings
import oss2

# 使用环境变量中获取的RAM用户的访问密钥配置访问凭证。
auth = oss2.Auth(settings.OSS_ACCESS_KEY_ID, settings.OSS_ACCESS_KEY_SECRET)
# yourEndpoint填写Bucket所在地域对应的Endpoint。以华东1（杭州）为例，Endpoint填写为https://oss-cn-hangzhou.aliyuncs.com。
endpoint = 'https://oss-cn-hangzhou.aliyuncs.com'
cname = 'https://doc.zjcxjc.cn'

# 填写Bucket名称。
bucket = oss2.Bucket(auth, cname, 'xu-bk-chengxiang',
                     is_cname=True, connect_timeout=30)
ds_bucket = oss2.Bucket(auth, endpoint, 'xu-digital-sign', connect_timeout=30)
digital_bucket = ds_bucket
# digital_cname = 'https://sign.zjcxjc.cn'
# digital_bucket = oss2.Bucket(
#     auth, digital_cname, 'xu-digital-sign',is_cname=True, connect_timeout=30)
